package com.tinem.platform.web.tool.controller;

import com.baidu.fsg.uid.UidGenerator;
import com.tinem.platform.module.pojo.vo.network.ip.IpInfoReq;
import com.tinem.platform.module.starter.sdk.api.LinkService;
import com.tinem.platform.module.starter.sdk.api.NetworkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * @author fengzhihao
 * @version v1
 * @program: platform
 * @className NetworkController
 * @description TODO
 * @site
 * @company
 * @create 2022/1/16 23:19:47
 */
@Slf4j
@Controller
@RequestMapping("network")
public class NetworkController {


    @Resource
    NetworkService networkService;

    @GetMapping(value = {"/ipLocat.do"})
    @ResponseBody
    public Object ipLocat(@RequestParam("ip")String ip) throws IOException {
        IpInfoReq req = new IpInfoReq();
        req.setIp(ip);
        return networkService.ipLocat(req);
    }
}
